home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Apple Shared Library Manager / ASLM Examples / TestTools / Sources / MiscTests.cp < prev    next >
Encoding:
Text File  |  1996-11-19  |  1.8 KB  |  97 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        MiscTests.cp
  3.  
  4.     Contains:    Miscellaneous tests
  5.  
  6.     Copyright:    © 1993 by Apple Computer, Inc., all rights reserved.
  7.  
  8. */
  9.  
  10. #ifndef __GLOBALNEW__
  11. #include <GlobalNew.h>
  12. #endif
  13. #ifndef __MISCTESTS__
  14. #include "MiscTests.h"
  15. #endif
  16.  
  17. //
  18. // Declare a TNoVTable static object so we can test having a static object
  19. // in the same library as the static objects implementation
  20. //
  21. static TNoVTable    gTestStatic(9);
  22.  
  23. /*******************************************************************************
  24. ** CLASS TNoVTable
  25. ********************************************************************************/
  26.  
  27. TNoVTable::TNoVTable(long value)
  28. {
  29.     fValue = value;
  30. }
  31.  
  32. TNoVTable::~TNoVTable()
  33. {
  34. }
  35.  
  36. long TNoVTable::Add(long value)
  37. {
  38.     gTestStatic.Sub(0);    // we need to generate a reference to gTestStatic somewhere
  39.     return (fValue += value);
  40. }
  41.  
  42. long TNoVTable::Sub(long value)
  43. {
  44.     return (fValue -= value);
  45. }
  46.  
  47. /*******************************************************************************
  48. ** CLASS TStdVTable
  49. ********************************************************************************/
  50.  
  51. TStdVTable::TStdVTable(long value)
  52. {
  53.     fValue = value;
  54. }
  55.  
  56. TStdVTable::~TStdVTable()
  57. {
  58. }
  59.  
  60. long TStdVTable::Add(long value)
  61. {
  62.     return (fValue += value);
  63. }
  64.  
  65. long TStdVTable::Sub(long value)
  66. {
  67.     return (fValue -= value);
  68. }
  69.  
  70. /*******************************************************************************
  71. ** CLASS TTimings
  72. ********************************************************************************/
  73.  
  74. TTimings::TTimings()
  75. {}
  76.  
  77. TTimings::~TTimings()
  78. {}
  79.  
  80. void TTimings::VirtualFunc()
  81. {}
  82.  
  83. void TTimings::Method()
  84. {}
  85.  
  86. void TTimings::StaticFunc(void*)
  87. {}
  88.  
  89. /*******************************************************************************
  90. ** ThrowException
  91. ********************************************************************************/
  92.  
  93. void ThrowException(long value)
  94. {
  95.     Fail(value);
  96. }
  97.